<template>
  <!-- 底部部分 -->
    <footer class="footer">
      <span class="todo-count"><strong>{{sum}}</strong>剩余</span>
      <ul class="filters">
        <li>
          <a :class="{selected:type==='all'}" href="#/" @click='change("all")'>全部</a>
        </li>
        <li>
          <a :class="{selected:type==='active'}" href="#/active" @click='change("active")'>进行中</a>
        </li>
        <li>
          <a :class="{selected:type==='completed'}" href="#/completed" @click='change("completed")'>已完成</a>
        </li>
      </ul>
      <button class="clear-completed" v-show='showBtn' @click='delOverBtn'>清除已完成</button>
    </footer>
</template>
 
<script>
export default {
  name: "footerComponent",
  components: {},
  props: {
    sum:{
      type:Number,
      required:true,
    },
    showBtn:{
      type:Boolean,
      required:true,
    },
    type:{
      type:String,
      required:true,
    }
  },
  data() {
    return {};
  },
  computed: {},
  watch: {},
  created() {},
  methods: {
    delOverBtn(){
      this.$emit('delOverBtn')
    },
    change(type){
      this.$emit('change',type)
    }
  }
};
</script>

<style scoped>
     
</style>